<?php
require_once("BaseNews.php");
require_once("MysqlConn.php");

class News_R extends BaseNews {
   public function queryInfo() {
      // @temp function
      $query = "select * from News order by NEW_ID desc limit 0, 1;";
      $conn = new MysqlConn();
      $conn->query($query);
      $r = $conn->next();

      if(empty($r)) {
         return;
      }

      $this->parseSqlResult($r);
   }

   public function parseSqlResult($r) {
      if(isset($r["NEW_TITLE"])) {
         $this->title = $r["NEW_TITLE"];
      }

      if(isset($r["NEW_CONTENT"])) {
         $this->content = $r["NEW_CONTENT"];
      }
   }
}
?>